<#include "header.html">

<!-- main start -->
    <body>
    <div style="margin:20px 0;"></div>
    <div class="easyui-panel" title="Mangement Login" style="width:400px;padding:30px 60px">
        <form id="loginForm" action="${request.contextPath}/manage/login" method="post">
        <div style="margin-bottom:20px">
            <div>username:</div>
            <input id="username" name="username" class="easyui-textbox" data-options="prompt:'Enter username'" style="width:100%;height:32px">
        </div>
        <div style="margin-bottom:20px">
            <div>password</div>
            <input id="password" name="password" class="easyui-passwordbox" data-options="prompt:'Enter password'" style="width:100%;height:32px">
        </div>

            <#if login_msg?exists && login_msg??><div><font color="red">${login_msg}</font></div></#if>
        <div>
            <a id="manageLogin" href="#" class="easyui-linkbutton" iconCls="icon-ok" style="width:100%;height:32px">Login</a>
        </div>
        </form>
    </div>
    </body>

    <script>
        $('#loginForm').bind('keyup', function(event) {/* 增加回车提交功能 */
            if (event.keyCode == '13') {
                $("#loginForm").submit();
            }
        });
        // 提交form
        $("#manageLogin").click(function(){
            $("#loginForm").submit();
//            var username = $("#username").val()
//            var password = $("#password").val()
//            $.ajax({
//                type: 'POST',
//                url: "${request.contextPath}/manage/login",
//                data: {
//                    username:username,
//                    password:password
//                }
//            }).success(function(){
//            }).error(function(){
//                alert('login error')
//            })
        })

    </script>
<!-- main end -->

<#include "footer.html">